Skip to content

Conversation

@Mutugiii
Copy link
Member

@Mutugiii Mutugiii commented Nov 4, 2025

Fixes #9285 #9067

Improve submissions document format:

  • Removes bloated team information from the "user" property and moves it to a slimmer, dedicated "team" property.
  • Clean up on getTeamName() request as we store teamName and teamType directly in submissions database

Add source to PDF/CSV exports

@Mutugiii Mutugiii linked an issue Nov 4, 2025 that may be closed by this pull request
@Mutugiii Mutugiii changed the title surveys: team surveys db formatting (fixes #9285 #9067) surveys: team submissions formatting (fixes #9285 #9067) Nov 4, 2025
@Mutugiii
Copy link
Member Author

Mutugiii commented Nov 4, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Copy link
Member

@paulbert paulbert left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry I got caught up a little today. Haven't been able to test yet, but wanted to add these comments on what I was able to read through.

...submission,
teamInfo: submission.team ? { name: submission.team.name, type: submission.team.type } : null
}));
return of<[any[], number, string[]]>([submissionsWithTeamInfo, time, questionTexts]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few things that were here before that could be improved:

  • This doesn't need to be a switchMap, it can just be a map since it's returning a static value not another observable. Then you can remove the of and just return the array on this line.
  • I think the indentation was a little off here. Bumping the switchMap, or map, down to a new line and then indenting the function would make this clearer.

})
).pipe(map((updatedSubmissions: any[]): [ any[], number, string[] ] => [ updatedSubmissions, time, questionTexts ])
);
return of<[any[], number, string[]]>([submissionsWithPlanetName, time, questionTexts]);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, since we're no longer pulling in team info here via another observable we can just use a map instead of switchMap and return the array.

@paulbert
Copy link
Member

I tried to test, but honestly I'm a bit confused about the expected user experience here.

As a manager I created a survey and sent it to a team. Then I logged in as a member of that team, but there wasn't a request to take the survey. I saw that the survey is available now in the team's list of surveys as a survey to record responses from the community.

I was curious how this differed from the team created surveys, and saw that when a team creates a survey there isn't a submissions document. That's more what I would expect on the database side for this kind of team survey. A submission document should be specific record of a survey or exam submission.

I might be missing something, but I'm having trouble seeing why this workflow is using the submissions database at all?

@dogi dogi changed the title surveys: team submissions formatting (fixes #9285 #9067) teams: smoother survey submissions formatting (fixes #9285) Nov 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

team surveys data formatting

5 participants